import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'

/**
 * 根路由
 */
export const constRootRouter = {
  title: '首页',
  key: '/',
  name: 'index',
  component: 'BasicLayout',
  redirect: '/workplace',
  children: []
}

export const constHomeMenu = {
  title: '首页',
  key: 'workplace',
  icon: 'home'
}

/**
 * 前端未找到页面路由（固定不用改）
 */
export const constNotFoundRouter = {
  path: '*',
  redirect: '/404',
  hidden: true
}

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'changePwd',
        name: 'changePwd',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/ChangePwd')
      },
      {
        path: 'bindWechat',
        name: 'bindWechat',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/bindWechat')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/PublicView/exception/404'),
    meta: {
      requireAuth: false
    }
  }
]

/**
 * 配置路由
 */
export const constantRouterComponents = {
  // 基础页面 layout 必须引入
  BasicLayout: BasicLayout, // 基础页面布局，包含了头部导航，侧边栏和通知栏
  BlankLayout: BlankLayout, // 空白的布局
  RouteView: RouteView, // 空布局，专门为了二级菜单内容区自定义
  PageView: PageView, // 基础布局，包含了面包屑，和中间内容区 (slot)
  UserLayout: UserLayout, // 登录注册页面的通用布局

  // 首页
  workplace: () => import('@/views/dashboard/Workplace'),
  // 会员管理
  headquartersInfo: () => import('@/views/member/detail/index'),
  formConfig: () => import('@/views/member/memberConfig/organization/joinConfig/index'),
  memberPost: () => import('@/views/member/memberConfig/organization/post/index'),
  // 活动管理
  activityCreate: () => import('@/views/activity/activityCreate'),
  activityUpdate: () => import('@/views/activity/activityUpdate'),
  activityDetail: () => import('@/views/activity/activityDetail'),
  activityStatistics: () => import('@/views/activity/activityStatistics'),
  activityConfig: () => import('@/views/activity/activityConfig'),
  activitySeatingPlan: () => import('@/views/activity/activitySeatingPlan'),
  registrationList: () => import('@/views/activity/registrationList'),
  registrationDetail: () => import('@/views/activity/registrationDetail'),
  coOrganizer: () => import('@/views/activity/coOrganizer'),
  // 内容管理
  albumDetail: () => import('@/views/content/album/albumDetail'),
  // 运营管理
  messageDetail: () => import('@/views/operations/message/detail'),
  createMessage: () => import('@/views/operations/message/create'),
  // 业务管理
  applyCooperation: () => import('@/views/business/cooperation/market/applyCooperation'),
  cooperationDetail: () => import('@/views/business/cooperation/detail'),
  // 终端管理
  miniProgramConfig: () => import('@/views/web/miniProgram/config'),
  webSiteConfig: () => import('@/views/web/webSite/config'),
  // 订单管理
  feesOrderDetail: () => import('@/views/order/feesOrder/detail'),
  businessOrderDetail: () => import('@/views/order/businessOrder/connections/detail'),
  businessOrderAccount: () => import('@/views/order/businessOrder/connections/account'),
  resourcesOrderDetail: () => import('@/views/order/businessOrder/resources/detail'),
  activityTicketOrderDetail: () => import('@/views/order/businessOrder/ActivityTicket/detail'),
  // 系统设置
  openOnlinePayment: () => import('@/views/system/paySettings/onlinePayment/open/index'),
  activityDetailsPreview: () => import('@/views/activity/activityDetailsPreview/index.vue'),
  invitationDetail: () => import('@/views/activity/invitationDetail/index.vue'),
}

/**
 * 三级菜单,不在权限菜单配置显示
 */
export const constMenus = [
  {
    title: '会员管理',
    key: 'member',
    icon: '',
    children: [
      {
        title: '会员详情',
        key: 'headquartersInfo',
        icon: '',
        hidden: true
      },
      {
        title: '表单配置',
        key: 'formConfig',
        icon: '',
        hidden: true
      },
      {
        title: '职务管理',
        key: 'memberPost',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '活动管理',
    key: 'activity',
    icon: '',
    children: [
      {
        title: '创建活动',
        key: 'activityCreate',
        icon: '',
        hidden: true
      },
      {
        title: '编辑活动',
        key: 'activityUpdate',
        icon: '',
        hidden: true
      },
      {
        title: '活动管理',
        key: 'activityDetail',
        icon: '',
        hidden: true
      },
      { title: '活动预览', key: 'activityDetailsPreview', icon: '', hidden: true },
      {
        title: '报名详情',
        key: 'registrationDetail',
        icon: '',
        hidden: true
      },
      {
        title: '活动数据中心',
        key: 'activityStatistics',
        icon: '',
        hidden: true
      },
      {
        title: '邀请详情',
        key: 'invitationDetail',
        icon: '',
        hidden: true
      },
      {
        title: '活动配置',
        key: 'activityConfig',
        icon: '',
        hidden: true,
        meta: {
          keepAlive: true
        }
      },
      {
        title: '协办组织 ',
        key: 'coOrganizer',
        icon: '',
        hidden: true
      },
      {
        title: '设备绑定',
        key: 'activityBindPrinter',
        icon: '',
        hidden: true
      },
      {
        title: '报名名单',
        key: 'registrationList',
        icon: '',
        hidden: true
      },

      {
        title: '活动排座',
        key: 'activitySeatingPlan',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '内容管理',
    key: 'content',
    icon: '',
    children: [
      {
        title: '相册详情',
        key: 'albumDetail',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '运营管理',
    key: 'operations',
    icon: '',
    children: [
      {
        title: '消息明细',
        key: 'messageDetail',
        icon: '',
        hidden: true
      },
      {
        title: '新建消息',
        key: 'createMessage',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '业务管理',
    key: 'business',
    icon: '',
    children: [
      {
        title: '跨组织合作',
        key: 'cooperation',
        icon: '',
        children: [
          {
            title: '申请合作',
            key: 'applyCooperation',
            icon: '',
            hidden: true
          },
          {
            title: '合作详情',
            key: 'cooperationDetail',
            icon: '',
            hidden: true
          }
        ]
      }
    ]
  },
  {
    title: '终端管理',
    key: 'web',
    icon: '',
    children: [
      {
        title: '小程序配置',
        key: 'miniProgramConfig',
        icon: '',
        hidden: true
      },
      {
        title: 'PC端官网配置',
        key: 'webSiteConfig',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '订单管理',
    key: 'order',
    icon: '',
    children: [
      {
        title: '会费订单详情',
        key: 'feesOrderDetail',
        icon: '',
        hidden: true
      },
      {
        title: '业务订单详情',
        key: 'businessOrderDetail',
        icon: '',
        hidden: true
      },
      {
        key: 'activityTicketOrderDetail',
        title: '报名订单详情',
        icon: '',
        hidden: true
      },
      {
        title: '资源平台订单详情',
        key: 'resourcesOrderDetail',
        icon: '',
        hidden: true
      },
      {
        title: '结算分润',
        key: 'businessOrderAccount',
        icon: '',
        hidden: true
      }
    ]
  },
  {
    title: '系统管理',
    key: 'system',
    icon: '',
    children: [
      {
        title: '开通易宝支付',
        key: 'openOnlinePayment',
        icon: '',
        hidden: true
      }
    ]
  }
]
